{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Logistic 回归——租赁兴趣分类"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# 首先 import 必要的模块\n",
    "import pandas as pd \n",
    "import numpy as np\n",
    "\n",
    "from sklearn.model_selection import GridSearchCV\n",
    "\n",
    "#评价指标为logloss\n",
    "from sklearn.metrics import log_loss  \n",
    "\n",
    "from matplotlib import pyplot\n",
    "import seaborn as sns\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 读取数据 & 数据探索"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "f:\\Anaconda2\\lib\\site-packages\\ipykernel_launcher.py:17: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
      "f:\\Anaconda2\\lib\\site-packages\\ipykernel_launcher.py:18: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
      "f:\\Anaconda2\\lib\\site-packages\\ipykernel_launcher.py:19: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n"
     ]
    }
   ],
   "source": [
    "# 读取数据\n",
    "# path to where the data lies\n",
    "dpath = './'\n",
    "train = pd.read_csv(dpath +\"RentListingInquries_FE_train.csv\")\n",
    "test  = pd.read_csv(dpath +\"RentListingInquries_FE_test.csv\")\n",
    "#将每一类的样本剥离出来，以便后续按照等比例进行数据采样\n",
    "\n",
    "y_train=train[\"interest_level\"]\n",
    "y_train_class0 = y_train[y_train==0]\n",
    "y_train_class1 = y_train[y_train==1]\n",
    "y_train_class2 = y_train[y_train==2]\n",
    "\n",
    "train_class0 = train[train[\"interest_level\"]==0]\n",
    "train_class1 = train[train[\"interest_level\"]==1]\n",
    "train_class2 = train[train[\"interest_level\"]==2]\n",
    "\n",
    "train_class0.drop([\"interest_level\"],axis=1,inplace = True)\n",
    "train_class1.drop([\"interest_level\"],axis=1,inplace = True)\n",
    "train_class2.drop([\"interest_level\"],axis=1,inplace = True)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>bathrooms</th>\n",
       "      <th>bedrooms</th>\n",
       "      <th>latitude</th>\n",
       "      <th>longitude</th>\n",
       "      <th>price</th>\n",
       "      <th>price_bathrooms</th>\n",
       "      <th>price_bedrooms</th>\n",
       "      <th>room_diff</th>\n",
       "      <th>room_num</th>\n",
       "      <th>Year</th>\n",
       "      <th>...</th>\n",
       "      <th>virtual</th>\n",
       "      <th>walk</th>\n",
       "      <th>walls</th>\n",
       "      <th>war</th>\n",
       "      <th>washer</th>\n",
       "      <th>water</th>\n",
       "      <th>wheelchair</th>\n",
       "      <th>wifi</th>\n",
       "      <th>windows</th>\n",
       "      <th>work</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>40.7388</td>\n",
       "      <td>-74.0018</td>\n",
       "      <td>2850</td>\n",
       "      <td>1425.0</td>\n",
       "      <td>1425.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2016</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>1.0</td>\n",
       "      <td>2</td>\n",
       "      <td>40.7488</td>\n",
       "      <td>-73.9770</td>\n",
       "      <td>3000</td>\n",
       "      <td>1500.0</td>\n",
       "      <td>1000.0</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>2016</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>40.8335</td>\n",
       "      <td>-73.9141</td>\n",
       "      <td>1350</td>\n",
       "      <td>675.0</td>\n",
       "      <td>675.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2016</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>37</th>\n",
       "      <td>1.0</td>\n",
       "      <td>0</td>\n",
       "      <td>40.7649</td>\n",
       "      <td>-73.9763</td>\n",
       "      <td>1980</td>\n",
       "      <td>990.0</td>\n",
       "      <td>1980.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>2016</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>64</th>\n",
       "      <td>1.0</td>\n",
       "      <td>1</td>\n",
       "      <td>40.7796</td>\n",
       "      <td>-73.9493</td>\n",
       "      <td>2200</td>\n",
       "      <td>1100.0</td>\n",
       "      <td>1100.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2016</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 224 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    bathrooms  bedrooms  latitude  longitude  price  price_bathrooms  \\\n",
       "2         1.0         1   40.7388   -74.0018   2850           1425.0   \n",
       "12        1.0         2   40.7488   -73.9770   3000           1500.0   \n",
       "28        1.0         1   40.8335   -73.9141   1350            675.0   \n",
       "37        1.0         0   40.7649   -73.9763   1980            990.0   \n",
       "64        1.0         1   40.7796   -73.9493   2200           1100.0   \n",
       "\n",
       "    price_bedrooms  room_diff  room_num  Year  ...   virtual  walk  walls  \\\n",
       "2           1425.0        0.0       2.0  2016  ...         0     0      0   \n",
       "12          1000.0       -1.0       3.0  2016  ...         0     0      0   \n",
       "28           675.0        0.0       2.0  2016  ...         0     0      0   \n",
       "37          1980.0        1.0       1.0  2016  ...         0     0      0   \n",
       "64          1100.0        0.0       2.0  2016  ...         0     0      0   \n",
       "\n",
       "    war  washer  water  wheelchair  wifi  windows  work  \n",
       "2     0       0      0           0     0        0     0  \n",
       "12    0       0      0           0     0        0     0  \n",
       "28    0       0      0           0     0        0     0  \n",
       "37    1       0      0           0     0        0     0  \n",
       "64    0       0      0           0     0        0     0  \n",
       "\n",
       "[5 rows x 224 columns]"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_class0.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZUAAAEKCAYAAADaa8itAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAGv9JREFUeJzt3X/QXmV95/H3h/BDqtaARCblR0Nt\nWkVbo6aYSqe1aCHQraArCuNKapmNdsDi9MeKbZdUkLa2Vbd0lV06pkDXNUbUktrYNKWgq1UgIL8i\nsqRoJSULwYCCjjjgd/+4r6fcCU+e5ySeOzc3eb9mztznfM91zv2955nkO+dc17lOqgpJkvqwz7gT\nkCQ9dVhUJEm9sahIknpjUZEk9caiIknqjUVFktQbi4okqTcWFUlSbywqkqTe7DvuBPa0Qw45pBYs\nWDDuNCRpotxwww33V9W82drtdUVlwYIFbNiwYdxpSNJESfKvXdp5+0uS1JuRFZUkT0tyXZKbk2xM\n8q4WvzTJV5Pc1JZFLZ4kFyXZlOSWJC8ZOteyJHe2ZdlQ/KVJbm3HXJQko/o9kqTZjfL21yPAcVX1\ncJL9gM8l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toMkOQmYAHwuR3aLAGOBj4/mAKK/RlM\ntzLlo+34ZwAvBz7W2gEc0D4/D1yaZDWwq5MRHg+8Oslvt+2nAUcCq4H1wAoGxeVjs7SXemNRkab3\nyND6Y0z/byXA+qo6fSfn+Hb73Ad4sKoW7digqt7arlx+GbgpyRPazCDAf6yqO56wI/lGkp8G3gC8\nZab2SQ7dhe+UZmSfirRrHgKe2da/CByb5McBkvxQkp/Y8YD2fo2vJjm1tUuSF7X151bVtVV1HnA/\ng1cYDH/HTNYBb2sz5ZLkxUP7VgH/BXhWVd3aob3UC4uKtGsuAT6d5Oqq2gr8KvCRJLcwKDLP28lx\nbwTOTHIzsJHHX/f8p0luTXIb8FngZuBq4OjZOuqBC4D9gFva8RcM7buCwSsQVndsL/XCWYolSb3x\nSkWS1BuLiiSpNxYVSVJvLCqSpN5YVCRJvbGoSJJ6Y1GRJPXGoiJJ6s3/BwScWvMWk7DpAAAAAElF\nTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xcd75b70>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 看看各类样本分布是否均衡\n",
    "sns.countplot(y_train);\n",
    "pyplot.xlabel('interest level');\n",
    "pyplot.ylabel('Number of occurrences');"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "各类样本不均衡。交叉验证对分类任务缺省的是采用StratifiedKFold，在每折采样时根据各类样本按比例采样"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "X_train_class0 = np.array(train_class0)\n",
    "X_train_class1 = np.array(train_class1)\n",
    "X_train_class2 = np.array(train_class2)\n",
    "\n",
    "X_test = np.array(test)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 由于数据量过大，先进行数据分割"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "f:\\Anaconda2\\lib\\site-packages\\sklearn\\cross_validation.py:41: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20.\n",
      "  \"This module will be removed in 0.20.\", DeprecationWarning)\n"
     ]
    }
   ],
   "source": [
    "#将数据分割训练数据与测试数据\n",
    "from sklearn.cross_validation import train_test_split\n",
    "\n",
    "# 随机采样25%的数据构建测试样本，其余作为训练样本\n",
    "X_train_class0_part, X_test_class0_part, y_train_class0_part, y_test_calss0_part = train_test_split(X_train_class0, y_train_class0, random_state=33, test_size=0.8)\n",
    "X_train_class1_part, X_test_class1_part, y_train_class1_part, y_test_calss1_part = train_test_split(X_train_class1, y_train_class1, random_state=33, test_size=0.8)\n",
    "X_train_class2_part, X_test_class2_part, y_train_class2_part, y_test_calss2_part = train_test_split(X_train_class2, y_train_class2, random_state=33, test_size=0.8)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "('the num of x downSample trainsets', (9868L, 224L))\n",
      "('the total num of x train sets', (49352, 225))\n",
      "('the num of y downSample trainsets', (9868L,))\n",
      "('the total num of y train sets', (49352, 225))\n"
     ]
    }
   ],
   "source": [
    "X_train_downSample = np.row_stack([X_train_class0_part,X_train_class1_part,X_train_class2_part])\n",
    "y_train_downSample = np.append(y_train_class0_part,y_train_class1_part)\n",
    "y_train_downSample = np.append(y_train_downSample,y_train_class2_part)\n",
    "\n",
    "print(\"the num of x downSample trainsets\",X_train_downSample.shape)\n",
    "print(\"the total num of x train sets\",train.shape)\n",
    "\n",
    "print(\"the num of y downSample trainsets\",y_train_downSample.shape)\n",
    "print(\"the total num of y train sets\",train.shape)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 数据预处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# 数据标准化\n",
    "from sklearn.preprocessing import StandardScaler\n",
    "\n",
    "# 初始化特征的标准化器\n",
    "ss_X = StandardScaler()\n",
    "\n",
    "# 分别对训练和测试数据的特征进行标准化处理\n",
    "\n",
    "X_train_downSample_trans = ss_X.fit_transform(X_train_downSample)\n",
    "X_test_downSample_trans = ss_X.fit_transform(X_test)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[-0.42143154  0.3924932  -0.12377103 ..., -0.0461804  -0.03021376\n",
      "  -0.02466568]\n",
      " [-0.42143154 -0.50034288 -0.0599393  ..., -0.0461804  -0.03021376\n",
      "  -0.02466568]\n",
      " [ 1.54252901  1.28532928  0.07064121 ..., -0.0461804  -0.03021376\n",
      "  -0.02466568]\n",
      " ..., \n",
      " [-0.42143154  0.3924932  -0.01978708 ..., -0.0461804  -0.03021376\n",
      "  -0.02466568]\n",
      " [-0.42143154  1.28532928  0.0138447  ..., -0.0461804  -0.03021376\n",
      "  -0.02466568]\n",
      " [-0.42143154  2.17816536 -0.08070177 ..., -0.0461804  -0.03021376\n",
      "  -0.02466568]]\n"
     ]
    }
   ],
   "source": [
    "print(X_train_downSample_trans)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 模型训练"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### default Logistic Regression"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from sklearn.linear_model import LogisticRegression\n",
    "lr= LogisticRegression()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "logloss of each fold is:  [ 0.72513085  0.78889752  0.74984035  0.71607142  0.75528945]\n",
      "cv logloss is: 0.747045918113\n"
     ]
    }
   ],
   "source": [
    "# 交叉验证用于评估模型性能和进行参数调优（模型选择）\n",
    "#分类任务中交叉验证缺省是采用StratifiedKFold\n",
    "from sklearn.cross_validation import cross_val_score\n",
    "loss = cross_val_score(lr, X_train_downSample_trans, y_train_downSample, cv=5, scoring='neg_log_loss')\n",
    "print 'logloss of each fold is: ',-loss\n",
    "print'cv logloss is:', -loss.mean()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 正则化的 Logistic Regression及参数调优"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "logistic回归的需要调整超参数有：C（正则系数，一般在log域（取log后的值）均匀设置候选参数）和正则函数penalty（L2/L1） \n",
    "目标函数为：J = sum(logloss(f(xi), yi)) + C* penalty \n",
    "\n",
    "在sklearn框架下，不同学习器的参数调整步骤相同：\n",
    "设置候选参数集合\n",
    "调用GridSearchCV\n",
    "调用fit"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "GridSearchCV(cv=5, error_score='raise',\n",
       "       estimator=LogisticRegression(C=1.0, class_weight=None, dual=False, fit_intercept=True,\n",
       "          intercept_scaling=1, max_iter=100, multi_class='ovr', n_jobs=1,\n",
       "          penalty='l2', random_state=None, solver='liblinear', tol=0.0001,\n",
       "          verbose=0, warm_start=False),\n",
       "       fit_params=None, iid=True, n_jobs=4,\n",
       "       param_grid={'penalty': ['l1', 'l2'], 'C': [0.001, 0.01, 0.1, 1, 10, 100, 1000]},\n",
       "       pre_dispatch='2*n_jobs', refit=True, return_train_score='warn',\n",
       "       scoring='neg_log_loss', verbose=0)"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.model_selection import GridSearchCV\n",
    "from sklearn.linear_model import LogisticRegression\n",
    "\n",
    "#需要调优的参数\n",
    "# 请尝试将L1正则和L2正则分开，并配合合适的优化求解算法（slover）\n",
    "#tuned_parameters = {'penalty':['l1','l2'],\n",
    "#                   'C': [0.001, 0.01, 0.1, 1, 10, 100, 1000]\n",
    "#                   }\n",
    "penaltys = ['l1','l2']\n",
    "Cs = [0.001, 0.01, 0.1, 1, 10, 100, 1000]\n",
    "tuned_parameters = dict(penalty = penaltys, C = Cs)\n",
    "\n",
    "lr_penalty= LogisticRegression()\n",
    "grid= GridSearchCV(lr_penalty, tuned_parameters,cv=5, scoring='neg_log_loss',n_jobs=4)\n",
    "grid.fit(X_train_downSample_trans,y_train_downSample)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "f:\\Anaconda2\\lib\\site-packages\\sklearn\\utils\\deprecation.py:122: FutureWarning: You are accessing a training score ('mean_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "f:\\Anaconda2\\lib\\site-packages\\sklearn\\utils\\deprecation.py:122: FutureWarning: You are accessing a training score ('split0_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "f:\\Anaconda2\\lib\\site-packages\\sklearn\\utils\\deprecation.py:122: FutureWarning: You are accessing a training score ('split1_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "f:\\Anaconda2\\lib\\site-packages\\sklearn\\utils\\deprecation.py:122: FutureWarning: You are accessing a training score ('split2_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "f:\\Anaconda2\\lib\\site-packages\\sklearn\\utils\\deprecation.py:122: FutureWarning: You are accessing a training score ('split3_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "f:\\Anaconda2\\lib\\site-packages\\sklearn\\utils\\deprecation.py:122: FutureWarning: You are accessing a training score ('split4_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n",
      "f:\\Anaconda2\\lib\\site-packages\\sklearn\\utils\\deprecation.py:122: FutureWarning: You are accessing a training score ('std_train_score'), which will not be available by default any more in 0.21. If you need training scores, please set return_train_score=True\n",
      "  warnings.warn(*warn_args, **warn_kwargs)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "{'mean_fit_time': array([  3.41199970e-01,   1.66939998e+00,   8.69400024e-01,\n",
       "          3.38020000e+00,   4.80700002e+00,   7.25980000e+00,\n",
       "          2.99982000e+01,   1.98020000e+01,   2.51245600e+02,\n",
       "          4.90980000e+01,   6.04614200e+02,   8.64644000e+01,\n",
       "          8.10908200e+02,   6.97752000e+01]),\n",
       " 'mean_score_time': array([ 0.0336    ,  0.01280003,  0.00999994,  0.00560002,  0.00700002,\n",
       "         0.00520005,  0.01020002,  0.00519996,  0.00819998,  0.00500002,\n",
       "         0.00600004,  0.00780005,  0.0112    ,  0.00960002]),\n",
       " 'mean_test_score': array([-0.87167769, -0.79986364, -0.70348355, -0.70368687, -0.68252006,\n",
       "        -0.7120852 , -0.71936756, -0.74704572, -0.76907718, -0.78440295,\n",
       "        -0.8123534 , -0.81329064, -0.85161229, -0.83495157]),\n",
       " 'mean_train_score': array([-0.87167761, -0.7824476 , -0.70023756, -0.66433452, -0.64933423,\n",
       "        -0.64225588, -0.63891101, -0.63825757, -0.63695839, -0.63694845,\n",
       "        -0.63669211, -0.63665515, -0.63666342, -0.63661618]),\n",
       " 'param_C': masked_array(data = [0.001 0.001 0.01 0.01 0.1 0.1 1 1 10 10 100 100 1000 1000],\n",
       "              mask = [False False False False False False False False False False False False\n",
       "  False False],\n",
       "        fill_value = ?),\n",
       " 'param_penalty': masked_array(data = ['l1' 'l2' 'l1' 'l2' 'l1' 'l2' 'l1' 'l2' 'l1' 'l2' 'l1' 'l2' 'l1' 'l2'],\n",
       "              mask = [False False False False False False False False False False False False\n",
       "  False False],\n",
       "        fill_value = ?),\n",
       " 'params': [{'C': 0.001, 'penalty': 'l1'},\n",
       "  {'C': 0.001, 'penalty': 'l2'},\n",
       "  {'C': 0.01, 'penalty': 'l1'},\n",
       "  {'C': 0.01, 'penalty': 'l2'},\n",
       "  {'C': 0.1, 'penalty': 'l1'},\n",
       "  {'C': 0.1, 'penalty': 'l2'},\n",
       "  {'C': 1, 'penalty': 'l1'},\n",
       "  {'C': 1, 'penalty': 'l2'},\n",
       "  {'C': 10, 'penalty': 'l1'},\n",
       "  {'C': 10, 'penalty': 'l2'},\n",
       "  {'C': 100, 'penalty': 'l1'},\n",
       "  {'C': 100, 'penalty': 'l2'},\n",
       "  {'C': 1000, 'penalty': 'l1'},\n",
       "  {'C': 1000, 'penalty': 'l2'}],\n",
       " 'rank_test_score': array([14,  9,  2,  3,  1,  4,  5,  6,  7,  8, 10, 11, 13, 12]),\n",
       " 'split0_test_score': array([-0.87185117, -0.79991866, -0.70097379, -0.69808931, -0.67662917,\n",
       "        -0.69762082, -0.70415825, -0.72513085, -0.76197716, -0.75550973,\n",
       "        -0.8013921 , -0.77537336, -0.82807563, -0.7931541 ]),\n",
       " 'split0_train_score': array([-0.8716285 , -0.78261841, -0.70077929, -0.66548096, -0.6508056 ,\n",
       "        -0.64414937, -0.64159725, -0.64042856, -0.63932035, -0.63934112,\n",
       "        -0.63907179, -0.63902003, -0.6390279 , -0.6389786 ]),\n",
       " 'split1_test_score': array([-0.87190352, -0.81657701, -0.71259805, -0.73201554, -0.70588769,\n",
       "        -0.74833654, -0.74690299, -0.78889752, -0.79458405, -0.82882118,\n",
       "        -0.83850733, -0.87546124, -0.87655829, -0.89551671]),\n",
       " 'split1_train_score': array([-0.87156233, -0.77837017, -0.696648  , -0.65964248, -0.64397039,\n",
       "        -0.63789634, -0.63573949, -0.63489617, -0.63443018, -0.63430033,\n",
       "        -0.63410814, -0.63407949, -0.63409443, -0.63403868]),\n",
       " 'split2_test_score': array([-0.87154449, -0.79528459, -0.69821693, -0.69642549, -0.67763617,\n",
       "        -0.70813035, -0.72408494, -0.74984035, -0.78249728, -0.79606443,\n",
       "        -0.82736035, -0.82915058, -0.88622517, -0.83784978]),\n",
       " 'split2_train_score': array([-0.87173241, -0.78354383, -0.70295413, -0.66594014, -0.65085418,\n",
       "        -0.64420772, -0.64163752, -0.64068071, -0.64005193, -0.63996382,\n",
       "        -0.63985476, -0.63981807, -0.63983885, -0.6397961 ]),\n",
       " 'split3_test_score': array([-0.87154449, -0.78863546, -0.69323856, -0.68752142, -0.66013822,\n",
       "        -0.68968953, -0.68653927, -0.71607142, -0.72507403, -0.74772734,\n",
       "        -0.76769666, -0.75823178, -0.80482313, -0.78320156]),\n",
       " 'split3_train_score': array([-0.87173241, -0.78567675, -0.70472514, -0.66836556, -0.65438097,\n",
       "        -0.64676408, -0.64460812, -0.64346802, -0.64272108, -0.64263161,\n",
       "        -0.64246518, -0.64241816, -0.64242833, -0.64238232]),\n",
       " 'split4_test_score': array([-0.87154449, -0.79889397, -0.71238836, -0.70437391, -0.69230318,\n",
       "        -0.71664503, -0.73515378, -0.75528945, -0.78124764, -0.79389883,\n",
       "        -0.82680841, -0.82824319, -0.86239046, -0.86504738]),\n",
       " 'split4_train_score': array([-0.87173241, -0.78202886, -0.69608124, -0.66224347, -0.64666003,\n",
       "        -0.63826189, -0.63097268, -0.63181439, -0.6282684 , -0.62850538,\n",
       "        -0.62796069, -0.62793999, -0.62792762, -0.62788519]),\n",
       " 'std_fit_time': array([  8.31177589e-02,   1.85106055e-02,   7.30523645e-02,\n",
       "          8.61937634e-02,   6.16421025e-01,   2.81569490e-01,\n",
       "          8.92530520e+00,   1.15618873e+00,   5.91006774e+01,\n",
       "          3.84965371e+00,   8.97193501e+01,   1.45575722e+01,\n",
       "          1.21364652e+02,   6.86271170e+00]),\n",
       " 'std_score_time': array([ 0.01831503,  0.0099478 ,  0.00428948,  0.00079998,  0.00352132,\n",
       "         0.00039999,  0.00775622,  0.00040004,  0.00396992,  0.00063241,\n",
       "         0.00063241,  0.00391921,  0.00696853,  0.00823651]),\n",
       " 'std_test_score': array([ 0.00016392,  0.0092448 ,  0.00776302,  0.01515557,  0.0154997 ,\n",
       "         0.0203058 ,  0.02162677,  0.02556322,  0.02435153,  0.02959586,\n",
       "         0.02542457,  0.04197674,  0.03059143,  0.04244591]),\n",
       " 'std_train_score': array([  7.03009932e-05,   2.38575124e-03,   3.40503931e-03,\n",
       "          3.05055401e-03,   3.62951328e-03,   3.54052121e-03,\n",
       "          4.90270017e-03,   4.25551827e-03,   5.10421882e-03,\n",
       "          5.00826540e-03,   5.13630553e-03,   5.12634665e-03,\n",
       "          5.13463078e-03,   5.13449014e-03])}"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# view the complete results (list of named tuples)\n",
    "grid.cv_results_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.682520062471\n",
      "{'penalty': 'l1', 'C': 0.1}\n"
     ]
    }
   ],
   "source": [
    "# examine the best model\n",
    "print(-grid.best_score_)\n",
    "print(grid.best_params_)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZQAAAEKCAYAAAA1qaOTAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAIABJREFUeJzs3XdYVMfXwPHvLL2jAoqgItYoWLF3\nY8Veo4klJsYUE03TmMSY6C95YzdFE1tibLHGrl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gX4Bmgh6oedzvPZWwZUFdEaolIKHA7MNnlTJc1\n50T2MCBTVd90O8+lEJG4M1dwikg40BE/fm/ZVV5FICITgPp4ryraDjyoqrvdTVU8IrIZKAccct5a\nUhqvWBORXsA7QBzwI7BSVVPdTVU0ItINeAvwAB+p6l9djlQsIvIp0AHvzLb7gRdUdZiroYpBRK4D\nvgTW4P23DvCcqk5zL1XxiEgTYATev1tBwDhV/bPfjmcFxRhjjC/YkJcxxhifsIJijDHGJ6ygGGOM\n8QkrKMYYY3zCCooxxhifsIJijA+JSM7Ft7rg/uNF5ErneQUR+UBEtjgzxS4UkV+JSKjz3G5MNiWK\nFRRjSggRSQY8qrrVeWso3skW66pqMnAnUNmZRHIOcJsrQY05DysoxviBeL3mzDm2RkRuc94PEpHB\nTo/jCxGZJiJpzm79gUnOdrWBXwF/VNUCAGdG4qnOtp872xtTYliX2Rj/6A00A5rivXN8mYgsBNoA\nScBVQBW8U6N/5OzTBvjUeZ6M967//PN8/lqghV+SG1NM1kMxxj+uAz51ZnrdDyzAWwCuA/6tqgWq\nug+Yd9Y+CcCBwny4U2hOOQtAGVMiWEExxj/ONS39hd4HOAGEOc8zgKYicqF/o+WA3GJkM8YvrKAY\n4x8LgducxY3igHbAN3iXYO3jnEupincyxTMygToAqroFWA685Mx+i4jUPbMGjIjEAgdUNS9QDTLm\nYqygGOMfE4HVwCpgLvB7Z4hrAt41UNYCH+BdCTDb2Wcqvyww9wLxwGYRWQMM4ee1Uq4HSt3st6Zs\ns9mGjQkwEamgqjlOL+MboI2q7nPWq5jnvD7fyfgzn/EZ8L+quiEAkY0pFLvKy5jA+8JZ9CgUeNnp\nuaCqJ0TkBbxryu84387OQlyfWzExJY31UIwxxviEnUMxxhjjE1ZQjDHG+IQVFGOMMT5hBcUYY4xP\nWEExxhjjE1ZQjDHG+MT/A9In7nqP80/3AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1106b828>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# plot CV误差曲线\n",
    "test_means = grid.cv_results_[ 'mean_test_score' ]\n",
    "test_stds = grid.cv_results_[ 'std_test_score' ]\n",
    "train_means = grid.cv_results_[ 'mean_train_score' ]\n",
    "train_stds = grid.cv_results_[ 'std_train_score' ]\n",
    "\n",
    "\n",
    "# plot results\n",
    "n_Cs = len(Cs)\n",
    "number_penaltys = len(penaltys)\n",
    "test_scores = np.array(test_means).reshape(n_Cs,number_penaltys)\n",
    "train_scores = np.array(train_means).reshape(n_Cs,number_penaltys)\n",
    "test_stds = np.array(test_stds).reshape(n_Cs,number_penaltys)\n",
    "train_stds = np.array(train_stds).reshape(n_Cs,number_penaltys)\n",
    "\n",
    "x_axis = np.log10(Cs)\n",
    "for i, value in enumerate(penaltys):\n",
    "    #pyplot.plot(log(Cs), test_scores[i], label= 'penalty:'   + str(value))\n",
    "    pyplot.errorbar(x_axis, test_scores[:,i], yerr=test_stds[:,i] ,label = penaltys[i] +' Test')\n",
    "    pyplot.errorbar(x_axis, train_scores[:,i], yerr=train_stds[:,i] ,label = penaltys[i] +' Train')\n",
    "    \n",
    "pyplot.legend()\n",
    "pyplot.xlabel( 'log(C)' )                                                                                                      \n",
    "pyplot.ylabel( 'neg-logloss' )\n",
    "pyplot.savefig('LogisticGridSearchCV_C.png' )\n",
    "\n",
    "pyplot.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 用LogisticRegressionCV实现正则化的 Logistic Regression"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "### L1正则"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "f:\\Anaconda2\\lib\\site-packages\\sklearn\\linear_model\\base.py:340: RuntimeWarning: overflow encountered in exp\n",
      "  np.exp(prob, prob)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "LogisticRegressionCV(Cs=[1, 10, 100, 1000], class_weight=None, cv=5,\n",
       "           dual=False, fit_intercept=True, intercept_scaling=1.0,\n",
       "           max_iter=100, multi_class='ovr', n_jobs=1, penalty='l1',\n",
       "           random_state=None, refit=True, scoring='neg_log_loss',\n",
       "           solver='liblinear', tol=0.0001, verbose=0)"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.linear_model import LogisticRegressionCV\n",
    "\n",
    "Cs = [1, 10,100,1000]\n",
    "\n",
    "# 大量样本（6W+）、高维度（93），L1正则 --> 可选用saga优化求解器(0.19版本新功能)\n",
    "# LogisticRegressionCV比GridSearchCV快\n",
    "lrcv_L1 = LogisticRegressionCV(Cs=Cs, cv = 5, scoring='neg_log_loss', penalty='l1', solver='liblinear', multi_class='ovr')\n",
    "lrcv_L1.fit(X_train_downSample_trans, y_train_downSample)  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{0: array([[-0.23931299, -0.25601243, -0.25516191, -0.25320456],\n",
       "        [-0.24163676, -0.24773909, -0.25761478, -0.30651848],\n",
       "        [-0.24128215, -0.26376254, -0.28803044, -0.31074127],\n",
       "        [-0.2375865 , -0.25502412, -0.27535244, -0.27969402],\n",
       "        [-0.26515664, -0.28072097, -0.29666974, -0.30808485]]),\n",
       " 1: array([[-0.50285076, -0.54898127, -0.5734977 , -0.58828892],\n",
       "        [-0.54523046, -0.59122235, -0.62694357, -0.65743183],\n",
       "        [-0.52019453, -0.56752049, -0.60836016, -0.65061081],\n",
       "        [-0.50687989, -0.54225825, -0.5807274 , -0.61168864],\n",
       "        [-0.55021602, -0.60145836, -0.64906989, -0.67317273]]),\n",
       " 2: array([[-0.54075342, -0.58732316, -0.61259384, -0.62885034],\n",
       "        [-0.57547818, -0.61994731, -0.66217424, -0.70109596],\n",
       "        [-0.56543403, -0.61461412, -0.6540693 , -0.68408795],\n",
       "        [-0.50795216, -0.5398957 , -0.57657146, -0.60824767],\n",
       "        [-0.56836982, -0.6003814 , -0.64450318, -0.69463008]])}"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lrcv_L1.scores_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEKCAYAAADjDHn2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAIABJREFUeJzt3Xl8VPW5x/HPw76DArLvoOxhCZta\nF6wWrYIKFLStUmspVkR7r4p4rVZoXbDWWqtVarH2VkEFVEQEqwVRW5WwBsJi2MOOkLAlZJnn/jGD\nN0bIDJDJzCTf9+uVF3NmzkmekwPz5Zxnfr9j7o6IiEhxKsS6ABERiX8KCxERCUthISIiYSksREQk\nLIWFiIiEpbAQEZGwFBYiIhKWwkJERMJSWIiISFiVYl1ASWnQoIG3bt061mWIiCSUJUuW7HP3huHW\nKzNh0bp1a1JSUmJdhohIQjGzLZGsp8tQIiISlsJCRETCUliIiEhYCgsREQlLYSEiImEpLEREJCyF\nhYiIhKWwEBFJUO7OvFU7mf7F1qj/rDIzKE9EpDxZtT2LSXPS+HzTfnq1rMeIPi0ws6j9PIWFiEgC\n2XMohyfnr+f1Jds4q0YVfnNtV0ZGOShAYSEikhBy8gp46dPNPLsgnZy8An56QRvuuKwDdatXLpWf\nr7AQEYljwb7ELh55bw3b9mfz3U6NuP+qjrRtWKtU61BYiIjEqVXbs5g4J40vNu3nvEa1+cdP+3Fh\nhwYxqUVhISISZ/YcyuF389fxxpKMb/QlKlWM3QdYFRYiInEiJ6+AqZ9u4tl/pZNb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GGivu/uc0noP0whuEREJqzxd\nhhIRkdOksBARkbAUFiIiEpbCQkREwlJYiIhIWAoLkVNgZofDr1Xs9jPMrG3ocS0ze8HMNoRmEV1k\nZv3MrErocbn5aLvEP4WFSCkJzTlU0d03hp56keBn4Tu4exeCY2EahCaH/BAYEZNCRU5AYSFyGkIj\nl58ws1VmlmpmI0LPVzCz50JnCnPMbK6ZDQtt9kPg7dB67YB+wAPuHgAIzSL8bmjdt0Lri8QFneaK\nnJ7rgR5AEtAAWGxmiwiOGG4NdAPOITjNytTQNhcA00KPuwDL3b3gJN9/FdAnKpWLnAadWYicnguB\naaFZQHcDHxF8c78QeMPdA+6+C1hQaJsmwN5IvnkoRHLNrHYJ1y1yWhQWIqfnZDeUKe5GM9lAtdDj\n1UCSmRX3b7AqkHMatYmUOIWFyOlZBIwI3YymIcFbqn4BfELwplMVzKwRwYkFj1sDtAdw9w1ACvBw\noRlPO5jZkNDj+sBed88rrR0SKY7CQuT0vAmsJHj/838B94YuO80keE+BVcALBO/KlhXa5l2+GR63\nAo2BdDNLJXjfkeP3hLiU4MyuInFBs86KlDAzq+Xuh0NnB18AF7j7rtA9CBaElk/W2D7+PWYBE9x9\nXSmULBKWPg0lUvLmhG5SUwWYFDrjwN2zzewhgvdJ3nqyjUM3tHpLQSHxRGcWIiISlnoWIiISlsJC\nRETCUliIiEhYCgsREQlLYSEiImEpLEREJKz/AycnB5z2R+ypAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1f17a9e8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "('C is:', array([1, 1, 1]))\n"
     ]
    }
   ],
   "source": [
    "# scores_：dict with classes as the keys, and the values as the grid of scores obtained during cross-validating each fold,\n",
    "# Each dict value has shape (n_folds, len(Cs))\n",
    "n_Cs = len(Cs)\n",
    "n_classes = 3\n",
    "scores =  np.zeros((n_classes,n_Cs))\n",
    "\n",
    "for j in range(n_classes):\n",
    "        scores[j][:] = np.mean(lrcv_L1.scores_[j],axis = 0)\n",
    "    \n",
    "mse_mean = -np.mean(scores, axis = 0)\n",
    "pyplot.plot(np.log10(Cs), mse_mean.reshape(n_Cs,1)) \n",
    "#plt.plot(np.log10(reg.Cs)*np.ones(3), [0.28, 0.29, 0.30])\n",
    "pyplot.xlabel('log(C)')\n",
    "pyplot.ylabel('logloss')\n",
    "pyplot.show()\n",
    "\n",
    "print ('C is:',lrcv_L1.C_)  #对多类分类问题，每个类别的分类器有一个C"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ -6.87394263e-01,   0.00000000e+00,  -1.72453645e-01,\n",
       "         -1.91631968e-01,   9.91863759e-01,  -2.27605481e+00,\n",
       "         -5.15514803e-01,  -3.03853747e-01,   0.00000000e+00,\n",
       "          0.00000000e+00,   0.00000000e+00,  -4.58579088e-02,\n",
       "          6.33333154e-02,  -8.19598332e-03,   2.93294526e-01,\n",
       "         -1.17966638e-01,   1.00601179e-02,   1.67696839e-01,\n",
       "         -1.78652043e-02,  -2.05895669e-01,  -1.14075887e-01,\n",
       "          1.96040768e-02,  -5.81296604e-02,   1.17203097e-01,\n",
       "          5.06080909e-02,  -2.71165385e-02,  -2.40594349e-01,\n",
       "          6.22871069e-02,  -8.22343248e-02,  -5.59232888e-02,\n",
       "          1.51171649e-02,  -7.48240969e-03,  -6.13663025e-02,\n",
       "         -2.52226333e-01,   4.44320348e-02,   0.00000000e+00,\n",
       "         -1.30962486e-01,   0.00000000e+00,  -9.01459921e-02,\n",
       "         -1.13191828e-01,   1.87090293e-02,   0.00000000e+00,\n",
       "          0.00000000e+00,   8.32025970e-03,  -2.33974912e-01,\n",
       "          0.00000000e+00,  -6.95567887e-02,  -1.66595930e-01,\n",
       "          1.60140731e-01,  -1.32779051e-01,   3.25716827e-03,\n",
       "          5.61824321e-02,  -3.97879810e-02,  -2.42380888e-03,\n",
       "          2.96091116e-02,   0.00000000e+00,   6.43266574e-02,\n",
       "          0.00000000e+00,   6.52693766e-02,   9.61687656e-03,\n",
       "          0.00000000e+00,   1.87399575e-02,   0.00000000e+00,\n",
       "          0.00000000e+00,   0.00000000e+00,   3.14634597e-02,\n",
       "          1.23229516e-03,   0.00000000e+00,   6.88217663e-02,\n",
       "         -3.77373052e-03,   0.00000000e+00,  -3.10569537e-02,\n",
       "          2.04968344e-01,  -1.19647839e-02,   3.00937599e-02,\n",
       "         -3.37398102e-02,   0.00000000e+00,  -4.79360683e-02,\n",
       "         -5.12017189e-02,   2.50593839e-02,   4.54956591e-02,\n",
       "         -2.01150761e-02,   7.75567406e-02,   7.73645579e-06,\n",
       "          0.00000000e+00,  -1.75599695e-01,   0.00000000e+00,\n",
       "          0.00000000e+00,   7.11828184e-02,   0.00000000e+00,\n",
       "          1.07149105e-01,   3.27480326e-02,   0.00000000e+00,\n",
       "          3.81357778e-01,  -1.24101863e-01,   0.00000000e+00,\n",
       "         -8.08163867e-02,  -7.27101235e-02,   6.62007664e-02,\n",
       "          2.45954690e-01,   0.00000000e+00,   0.00000000e+00,\n",
       "          0.00000000e+00,   1.44314898e-01,  -1.62186500e-01,\n",
       "          1.05422437e-01,   1.19680887e-01,  -4.76960171e-02,\n",
       "         -7.43024652e-02,  -1.46321440e-01,   0.00000000e+00,\n",
       "          0.00000000e+00,   0.00000000e+00,   0.00000000e+00,\n",
       "         -1.34718232e-01,  -1.96494685e-01,   9.74152936e-02,\n",
       "         -1.12213279e-01,   1.10313391e-01,  -7.90931041e-02,\n",
       "         -2.78253375e-03,   0.00000000e+00,  -2.77378657e-03,\n",
       "          7.90662152e-02,  -5.47347385e-02,   1.38470127e-01,\n",
       "          2.32356741e-02,  -1.00616844e-01,  -2.17630404e-01,\n",
       "          1.21994845e-01,   0.00000000e+00,  -1.01689778e-01,\n",
       "          7.50020970e-02,  -1.10060779e-01,  -4.55777321e-02,\n",
       "          0.00000000e+00,   0.00000000e+00,  -1.24573174e-01,\n",
       "         -6.08903388e-02,  -9.75465800e-02,  -7.89827747e-03,\n",
       "          0.00000000e+00,  -1.67280825e-01,   1.58743075e-02,\n",
       "          2.63382281e-02,   0.00000000e+00,   6.22352703e-03,\n",
       "         -7.47340153e-02,   0.00000000e+00,   7.93517198e-02,\n",
       "          0.00000000e+00,  -5.65284984e-02,  -1.13176973e-01,\n",
       "         -7.72856731e-02,  -3.26908519e-03,   4.16226308e-02,\n",
       "         -1.51256302e-01,  -3.88433683e-02,   0.00000000e+00,\n",
       "         -4.29549553e-03,   3.57645500e-02,  -1.06939382e-02,\n",
       "         -9.60968042e-02,   0.00000000e+00,  -8.94375259e-02,\n",
       "         -3.42823631e-02,   8.50127626e-02,   5.68602176e-02,\n",
       "         -2.32786459e-02,   0.00000000e+00,  -5.83845641e-02,\n",
       "         -3.37736790e-02,  -8.80965054e-02,   0.00000000e+00,\n",
       "          7.72223873e-02,   1.43332369e-01,   0.00000000e+00,\n",
       "          1.76372606e-01,   0.00000000e+00,   5.94328044e-02,\n",
       "          5.63674070e-02,  -2.44474043e-01,  -1.60201777e-01,\n",
       "         -5.41112599e-02,  -1.40545929e-01,   2.59111243e-02,\n",
       "         -5.12259138e-02,  -6.47588734e-03,   0.00000000e+00,\n",
       "         -2.69076795e-02,   0.00000000e+00,   3.12942459e-01,\n",
       "          0.00000000e+00,  -2.28805660e-01,  -8.71680184e-03,\n",
       "          3.41265155e-02,  -8.52528978e-02,   1.05452671e-01,\n",
       "         -6.73843665e-02,   0.00000000e+00,   0.00000000e+00,\n",
       "          8.28917182e-04,   8.12958048e-03,   0.00000000e+00,\n",
       "         -1.61930347e-03,   0.00000000e+00,  -6.48584317e-02,\n",
       "         -9.34822077e-03,   4.07462687e-02,   0.00000000e+00,\n",
       "         -1.78012986e-01,   0.00000000e+00,   0.00000000e+00,\n",
       "         -3.50830056e-02,  -2.40496535e-02,   0.00000000e+00,\n",
       "          0.00000000e+00,  -1.32432225e-01,  -1.62089423e-01,\n",
       "          9.24153881e-02,   3.86078188e-02,  -4.93353974e-02,\n",
       "          0.00000000e+00,   0.00000000e+00],\n",
       "       [ -3.15723372e-01,   0.00000000e+00,  -1.86138281e-01,\n",
       "         -2.13626205e-01,   4.44298497e-01,  -1.09340078e+00,\n",
       "         -1.65782343e-01,  -3.38312416e-01,   0.00000000e+00,\n",
       "          0.00000000e+00,   0.00000000e+00,  -7.78443988e-03,\n",
       "          2.02622568e-02,  -4.57235844e-02,   1.54904567e-01,\n",
       "          4.84708121e-02,   5.55267690e-02,   3.38092223e-02,\n",
       "         -3.17598398e-02,  -5.71694670e-02,  -2.99396809e-03,\n",
       "          6.62296365e-04,  -2.24737110e-02,   3.73906830e-02,\n",
       "         -1.80772151e-01,   2.36098280e-01,   0.00000000e+00,\n",
       "         -1.88949129e-02,  -1.44130428e-01,   0.00000000e+00,\n",
       "         -1.01992716e-02,  -2.19094910e-02,  -8.47980403e-02,\n",
       "         -1.96045198e-02,  -4.31297877e-02,   0.00000000e+00,\n",
       "         -3.06505449e-01,  -1.43135905e-01,   1.36067656e-01,\n",
       "          1.94968145e-01,   1.85682515e-02,   2.66251086e-01,\n",
       "         -5.26557764e-02,  -2.33361994e-01,  -1.36509085e-01,\n",
       "         -3.11900409e-01,   9.98456602e-02,   7.47137794e-02,\n",
       "          0.00000000e+00,  -6.31857444e-02,  -7.70526587e-02,\n",
       "          0.00000000e+00,  -2.76470039e-02,  -4.50492805e-02,\n",
       "          8.68976193e-02,   1.84852062e-01,   6.50741744e-02,\n",
       "          0.00000000e+00,   1.31883791e-01,   7.82688101e-02,\n",
       "          0.00000000e+00,  -5.48853737e-02,   1.66426986e-01,\n",
       "          1.42920083e-02,   0.00000000e+00,  -1.78895492e-01,\n",
       "         -2.35839661e-01,   6.54507282e-02,   0.00000000e+00,\n",
       "          1.27497356e-01,   0.00000000e+00,  -1.95115909e-03,\n",
       "         -3.06347505e-01,   2.87120516e-02,  -4.13806295e-02,\n",
       "          7.18712799e-02,  -3.03087199e-02,   4.32237444e-02,\n",
       "          0.00000000e+00,   3.39546220e-01,   1.17699469e-01,\n",
       "          6.59305602e-02,  -7.43146506e-03,  -2.20781662e-01,\n",
       "          0.00000000e+00,   5.63501827e-03,   3.11113288e-01,\n",
       "         -9.48481408e-02,   2.70990070e-02,  -1.38925437e-01,\n",
       "         -1.92841509e-02,   0.00000000e+00,  -4.24089296e-02,\n",
       "          2.26187963e-01,   2.23753249e-03,  -7.57640313e-02,\n",
       "         -1.54971585e-02,   0.00000000e+00,   1.77485826e-01,\n",
       "          3.84382652e-02,   0.00000000e+00,  -1.33560165e-01,\n",
       "          0.00000000e+00,   1.16844688e-01,  -6.14474570e-02,\n",
       "          5.18742877e-02,   2.88350044e-01,  -4.37765765e-02,\n",
       "         -6.16102693e-02,   4.81356923e-02,   0.00000000e+00,\n",
       "          2.84425859e-01,  -1.56243933e-01,   5.16644206e-02,\n",
       "         -6.35431522e-02,   1.55560322e-01,  -9.14905043e-02,\n",
       "          7.26833065e-02,   5.74999972e-03,  -7.71787936e-02,\n",
       "         -4.47715623e-01,   2.97699897e-01,   0.00000000e+00,\n",
       "         -5.88708952e-01,   1.18424877e-01,   5.57580196e-02,\n",
       "         -1.61821738e-02,  -2.68832164e-02,  -1.80280867e-01,\n",
       "         -2.42126928e-01,   0.00000000e+00,   1.60666602e-01,\n",
       "          5.27725726e-02,   1.17065318e-01,  -1.34349747e-01,\n",
       "          0.00000000e+00,   6.27028529e-02,   9.64946679e-02,\n",
       "          2.11954337e-01,   4.71741488e-02,   5.86096718e-02,\n",
       "         -2.36554711e-02,  -9.74265719e-02,  -6.70619228e-07,\n",
       "         -4.83829323e-02,   0.00000000e+00,  -5.56645547e-02,\n",
       "          0.00000000e+00,   2.86824396e-01,  -4.90689101e-02,\n",
       "          1.32500905e-03,   9.94204431e-02,  -4.90408636e-02,\n",
       "         -9.07928624e-04,  -2.31974663e-02,  -1.09442790e-02,\n",
       "          0.00000000e+00,   8.77520341e-02,  -2.96139364e-02,\n",
       "         -1.55553524e-02,  -1.32815334e-01,   6.51331767e-02,\n",
       "         -4.81881832e-02,  -1.57317186e-02,   1.64434036e-03,\n",
       "          3.77373182e-02,   7.94050369e-02,   2.97604712e-03,\n",
       "          8.42272661e-03,  -2.10787602e-01,   2.53157164e-02,\n",
       "         -8.65129031e-02,   0.00000000e+00,  -3.91448381e-01,\n",
       "          5.43834047e-04,   1.64630516e-01,   0.00000000e+00,\n",
       "         -7.55465123e-02,  -9.60771186e-02,   4.33628641e-03,\n",
       "          1.20675935e-02,  -1.95678972e-01,  -1.00133174e-02,\n",
       "          7.62372548e-02,   1.02357051e-02,  -2.74075360e-01,\n",
       "          4.38300788e-02,   0.00000000e+00,   1.25625261e-02,\n",
       "          1.19520558e-01,   3.35534755e-02,   0.00000000e+00,\n",
       "         -9.85445915e-02,   9.76013633e-02,  -7.95471422e-02,\n",
       "         -1.07918440e-01,  -6.61075782e-02,   6.88087827e-02,\n",
       "          1.63512510e-01,  -9.34644612e-02,  -6.30893359e-02,\n",
       "          2.02950927e-03,  -4.43602746e-02,  -5.67021439e-02,\n",
       "          0.00000000e+00,   0.00000000e+00,   4.71503322e-01,\n",
       "         -5.85808969e-02,   6.51483334e-02,   1.30666532e-01,\n",
       "          0.00000000e+00,   0.00000000e+00,  -1.03158630e-01,\n",
       "          1.04081497e-01,   8.64989797e-02,   3.10950663e-03,\n",
       "          0.00000000e+00,  -5.71744431e-02,  -5.04284136e-02,\n",
       "          0.00000000e+00,  -5.11684480e-02,   7.87377595e-03,\n",
       "          3.68058361e-01,   7.02983078e-02],\n",
       "       [  6.69699468e-01,   0.00000000e+00,   4.95020930e-01,\n",
       "          5.32733897e-01,  -1.20185615e+00,   2.01961873e+00,\n",
       "          3.18704552e-01,   4.28023029e-01,   0.00000000e+00,\n",
       "          0.00000000e+00,   0.00000000e+00,   1.79993174e-02,\n",
       "         -4.34592574e-02,   5.09122286e-02,  -2.69869199e-01,\n",
       "          0.00000000e+00,  -5.62773736e-02,  -9.90831738e-02,\n",
       "          3.84099953e-02,   1.18490454e-01,   4.79371456e-02,\n",
       "         -4.35304180e-05,   5.30930344e-02,  -7.83885437e-02,\n",
       "          2.92398099e-01,  -9.11333852e-02,   0.00000000e+00,\n",
       "          0.00000000e+00,   1.46538584e-01,   4.20138089e-02,\n",
       "          0.00000000e+00,   1.40196328e-02,   8.34918742e-02,\n",
       "          1.94864989e-01,  -2.15018786e-03,  -1.84519562e-02,\n",
       "          3.18719104e-01,   7.61877743e-02,  -1.19620018e-01,\n",
       "         -1.93996064e-01,  -1.16858993e-02,   1.02847637e-01,\n",
       "          1.18763229e-01,   1.00272936e-01,   3.90869792e-01,\n",
       "          2.14607355e-01,  -5.07431206e-02,  -4.38272852e-02,\n",
       "          0.00000000e+00,   1.54015399e-01,   1.95876932e-02,\n",
       "         -9.95870878e-02,   6.55457165e-02,   4.32631749e-02,\n",
       "         -8.46795371e-02,   1.24850861e-01,  -9.75055398e-02,\n",
       "          0.00000000e+00,  -1.50790403e-01,  -8.77200710e-02,\n",
       "          0.00000000e+00,   5.18799686e-02,   4.84296485e-04,\n",
       "          0.00000000e+00,  -3.42849085e-02,   5.60981466e-02,\n",
       "          2.16552232e-01,  -1.03187489e-01,  -1.09472432e-02,\n",
       "         -5.62650130e-02,   0.00000000e+00,   3.98509756e-02,\n",
       "          4.52665603e-03,  -2.45915393e-02,   3.00469456e-02,\n",
       "         -5.31248764e-02,   3.12370144e-02,  -4.21691404e-02,\n",
       "         -2.61964029e-02,  -3.20987062e-01,  -1.10645009e-01,\n",
       "         -5.02320178e-02,  -7.28964325e-03,   2.27993075e-01,\n",
       "          0.00000000e+00,   2.36910949e-02,  -1.50928081e-01,\n",
       "          1.08440469e-01,  -5.75056471e-02,   0.00000000e+00,\n",
       "         -3.99192477e-02,  -2.65774495e-02,   5.84995341e-02,\n",
       "         -3.46743335e-01,   2.19295170e-02,   8.20897469e-02,\n",
       "          2.85420966e-02,   0.00000000e+00,  -1.73892320e-01,\n",
       "         -1.96860475e-01,   0.00000000e+00,   0.00000000e+00,\n",
       "          0.00000000e+00,  -1.93293220e-01,   4.89870186e-02,\n",
       "         -1.11585740e-01,  -1.82872787e-01,   5.38785936e-02,\n",
       "          3.99213870e-02,  -6.21805660e-02,   0.00000000e+00,\n",
       "         -1.53274289e-01,   0.00000000e+00,  -3.48981577e-02,\n",
       "          1.20830290e-01,  -2.88092158e-01,  -1.03727489e-01,\n",
       "         -6.22200512e-02,  -2.33624073e-01,   5.00614624e-01,\n",
       "          4.88876212e-01,  -9.40686279e-02,   0.00000000e+00,\n",
       "          2.24691507e-01,  -2.78971475e-02,  -1.12702064e-01,\n",
       "          2.53675748e-05,   8.30106600e-02,   2.94255588e-01,\n",
       "         -2.41897988e-01,   2.78883512e-03,   0.00000000e+00,\n",
       "         -7.64136178e-02,   0.00000000e+00,   1.64046424e-01,\n",
       "          0.00000000e+00,  -8.37979867e-02,  -6.41810192e-02,\n",
       "         -1.62476787e-01,  -1.55602799e-02,  -5.60166594e-02,\n",
       "          3.51374158e-02,   1.56090415e-01,   1.26934671e-03,\n",
       "          0.00000000e+00,   0.00000000e+00,   3.73807887e-02,\n",
       "          0.00000000e+00,  -4.13926325e-01,   0.00000000e+00,\n",
       "          0.00000000e+00,  -1.06390310e-01,   1.08712776e-01,\n",
       "          2.38526001e-02,   3.57274560e-02,   0.00000000e+00,\n",
       "          3.39456379e-02,  -9.39401185e-02,   6.82786040e-02,\n",
       "          5.34783251e-02,   9.87738796e-02,  -6.25972105e-02,\n",
       "          2.31653697e-02,   0.00000000e+00,   1.58862277e-02,\n",
       "         -5.65512475e-02,  -1.25027296e-01,  -2.49750682e-01,\n",
       "          0.00000000e+00,   0.00000000e+00,   0.00000000e+00,\n",
       "          8.01682077e-02,   6.92650993e-02,   3.54309653e-01,\n",
       "         -7.69079481e-02,  -2.72613815e-01,   0.00000000e+00,\n",
       "         -1.49872528e-01,   9.44729829e-02,  -9.69447230e-02,\n",
       "         -9.78208148e-03,   2.42707683e-01,   7.07978381e-02,\n",
       "         -7.36095192e-02,   6.46377870e-02,   4.01273530e-01,\n",
       "         -4.73082218e-02,   0.00000000e+00,  -4.13581515e-02,\n",
       "         -7.03393335e-02,   0.00000000e+00,  -2.48779171e-01,\n",
       "          5.10112358e-02,  -8.28170063e-02,   1.43970517e-01,\n",
       "          5.32827833e-03,   8.91173075e-02,  -1.36283462e-01,\n",
       "         -1.84798301e-01,   1.03823172e-01,   8.67003079e-02,\n",
       "         -4.77655477e-02,   3.72347208e-02,   4.02458925e-02,\n",
       "          6.27835654e-02,   0.00000000e+00,  -2.07373040e-01,\n",
       "          7.28837861e-02,  -6.74427052e-02,  -4.41511549e-01,\n",
       "          1.62690459e-02,   0.00000000e+00,   6.43331358e-02,\n",
       "         -2.22639207e-02,  -6.24345849e-02,   0.00000000e+00,\n",
       "          0.00000000e+00,   6.38848289e-02,   9.44631163e-02,\n",
       "         -4.03439379e-01,   1.05887129e-02,   1.32158339e-02,\n",
       "         -1.79258654e-01,  -9.05831077e-02]])"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lrcv_L1.coef_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-0.267965334092\n",
      "-0.584830201508\n",
      "-0.60934866629\n"
     ]
    }
   ],
   "source": [
    "for i in np.arange(0,3):\n",
    "    print(lrcv_L1.scores_[i].mean().max())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "由图可以看出logloss在左侧是最好，可以在左侧继续搜寻"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "LogisticRegressionCV(Cs=[0.01, 0.1, 1, 10, 100], class_weight=None, cv=5,\n",
       "           dual=False, fit_intercept=True, intercept_scaling=1.0,\n",
       "           max_iter=100, multi_class='ovr', n_jobs=4, penalty='l1',\n",
       "           random_state=None, refit=True, scoring='neg_log_loss',\n",
       "           solver='liblinear', tol=0.0001, verbose=0)"
      ]
     },
     "execution_count": 57,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Cs_left = [0.01,0.1,1,10,100]\n",
    "lrcv_L1_left = LogisticRegressionCV(Cs=Cs_left, cv = 5, scoring='neg_log_loss', penalty='l1', solver='liblinear', multi_class='ovr',n_jobs=4)\n",
    "lrcv_L1_left.fit(X_train_downSample_trans, y_train_downSample) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{0: array([[-0.24763474, -0.22630544, -0.23916765, -0.25566792, -0.25882837],\n",
       "        [-0.25076655, -0.23722654, -0.24163365, -0.24769767, -0.25768782],\n",
       "        [-0.24561569, -0.22802503, -0.24128321, -0.2638807 , -0.2877908 ],\n",
       "        [-0.24698919, -0.22684218, -0.23758732, -0.25501783, -0.29025161],\n",
       "        [-0.25507354, -0.24064745, -0.26515562, -0.28067297, -0.29666917]]),\n",
       " 1: array([[-0.49341144, -0.48938622, -0.50284086, -0.5488281 , -0.57263195],\n",
       "        [-0.49967229, -0.50471307, -0.54521905, -0.59123231, -0.62671879],\n",
       "        [-0.49179453, -0.48680883, -0.52017132, -0.56765741, -0.6061121 ],\n",
       "        [-0.48807632, -0.48001334, -0.50689118, -0.54226027, -0.5806863 ],\n",
       "        [-0.49550866, -0.49405545, -0.55024038, -0.60028728, -0.64801224]]),\n",
       " 2: array([[-0.5197616 , -0.5141918 , -0.54062287, -0.5878063 , -0.61251683],\n",
       "        [-0.53154944, -0.54132383, -0.57546415, -0.62017614, -0.66215098],\n",
       "        [-0.51840324, -0.51951129, -0.56545668, -0.614756  , -0.65387408],\n",
       "        [-0.50941998, -0.49334197, -0.50796703, -0.54009071, -0.57448695],\n",
       "        [-0.53017839, -0.52448328, -0.56813633, -0.60573512, -0.64029103]])}"
      ]
     },
     "execution_count": 58,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lrcv_L1_left.scores_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-0.252964746758\n",
      "-0.537329188117\n",
      "-0.562867840703\n"
     ]
    }
   ],
   "source": [
    "#打印每个类别的score\n",
    "for i in np.arange(0,3):\n",
    "    print(lrcv_L1_left.scores_[i].mean().max())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEKCAYAAADjDHn2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAIABJREFUeJzt3Xd8VfX9x/HXh7AkrEBYAiEiQ4aM\nEJZaq1YtVSutYhVEQUHQSmuHtna3+mtrta2trVVBUUSWW4q21G2HjLC3LIGIEGaY2Z/fH/dCUwzJ\nDeTk3CTv5+ORR+449973PZC88z3n3O8xd0dERKQ0tcIOICIi8U9lISIiZVJZiIhImVQWIiJSJpWF\niIiUSWUhIiJlUlmIiEiZVBYiIlImlYWIiJSpdtgBKkpycrKnpqaGHUNEpEpZtGjRbndvUdZy1aYs\nUlNTycjICDuGiEiVYmZbYllOm6FERKRMKgsRESmTykJERMqkshARkTKpLEREpEwqCxERKZPKQkRE\nyqSyEBGpwmYs2Mr7H+0K/HVUFiIiVVBhkfOrN9bwg5dX8ELGtsBfr9p8gltEpKY4klfAt2Yu5R+r\nd3Lz4A789Krugb+mykJEpArZeSCHsVMyWLU9m59/uTujzz+rUl5XZSEiUkWs3n6AMVMWcuBoPk+O\nSueSc1pV2murLEREqoB31u5kwvQlNDmjDi/cfh7dz2xcqa+vshARiXNP/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FTk11wB9gN5AMrDQzD4gMpVIKnAukRlw1wCTo485n8ingwF6AEvdvfAkz78S6B9IcpFToJGF\nyKm5gMhMrYXuvhN4n8gv9wuAF9y9yN13EJk+45g2wK5YnjxaInnH5gATCZvKQuTUnOykRaWdzOgo\nkfmhIDK3UG8zK+1nsB6QcwrZRCqcykLk1HwAXG9mCWbWgsipOBcA/yJyIqFaZtaKyCk4j1kDdALw\nyLk0MoBfFJvBtLOZDY1ebg7scvf8ynpDIqVRWYicmleIzP65DHgH+F50s9NLRGYqXQk8QeRMZtnR\nx7zO/5bHWCInddpgZiuInEvi2LkHLgbeCPYtiMROs86KVDAza+iRs6g1JzLaON/dd5jZGUT2YZxf\nyo7tY8/xMvADj8PzsUvNpKOhRCreHDNrCtQF7o+OOHD3o2b2MyLnRN56sgdHT1L0qopC4olGFiIi\nUibtsxARkTKpLEREpEwqCxERKZPKQkREyqSyEBGRMqksRESkTP8PSSsXD2acxj0AAAAASUVORK5C\nYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1454d0b8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "('C is:', array([ 0.1,  0.1,  0.1]))\n"
     ]
    }
   ],
   "source": [
    "n_Cs_left = len(Cs_left)\n",
    "n_classes = 3\n",
    "scores =  np.zeros((n_classes,n_Cs_left))\n",
    "\n",
    "for j in range(n_classes):\n",
    "        scores[j][:] = np.mean(lrcv_L1_left.scores_[j],axis = 0)\n",
    "    \n",
    "mse_mean = -np.mean(scores, axis = 0)\n",
    "pyplot.plot(np.log10(Cs_left), mse_mean.reshape(n_Cs_left,1)) \n",
    "#plt.plot(np.log10(reg.Cs)*np.ones(3), [0.28, 0.29, 0.30])\n",
    "#pyplot.axis([-2,2,0.450,0.452])\n",
    "\n",
    "pyplot.xlabel('log(C)')\n",
    "pyplot.ylabel('logloss')\n",
    "pyplot.show()\n",
    "\n",
    "print ('C is:',lrcv_L1_left.C_)  #对多类分类问题，每个类别的分类器有一个C"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "经过再次计算，可以看到当C=0.1时，效果最佳"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#L2正则"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "LogisticRegressionCV(Cs=[0.01, 0.1, 1, 10, 100], class_weight=None, cv=5,\n",
       "           dual=False, fit_intercept=True, intercept_scaling=1.0,\n",
       "           max_iter=100, multi_class='ovr', n_jobs=1, penalty='l2',\n",
       "           random_state=None, refit=True, scoring='neg_log_loss',\n",
       "           solver='liblinear', tol=0.0001, verbose=0)"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.linear_model import LogisticRegressionCV\n",
    "\n",
    "Cs = [0.01,0.1,1, 10,100,1000]\n",
    "\n",
    "# 大量样本（6W+）、高维度（93），L2正则 --> 缺省用lbfgs，为了和GridSeachCV比较，也用liblinear\n",
    "\n",
    "lr_cv_L2 = LogisticRegressionCV(Cs=Cs, cv = 5, scoring='neg_log_loss', penalty='l2', solver='liblinear', multi_class='ovr')\n",
    "lr_cv_L2.fit(X_train_downSample, y_train_downSample) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{0: array([[-0.22837268, -0.22605945, -0.22858223, -0.22823211, -0.22788891],\n",
       "        [-0.23896908, -0.23600478, -0.23708516, -0.23707088, -0.23302541],\n",
       "        [-0.22833267, -0.22806975, -0.22659719, -0.22672481, -0.22740917],\n",
       "        [-0.22723551, -0.22350151, -0.22436441, -0.227992  , -0.22296131],\n",
       "        [-0.2492852 , -0.24682913, -0.24935572, -0.24713049, -0.24769384]]),\n",
       " 1: array([[-0.48622234, -0.48697343, -0.48672768, -0.48665116, -0.48593473],\n",
       "        [-0.49843269, -0.49912823, -0.49981028, -0.4998724 , -0.49681347],\n",
       "        [-0.48761874, -0.48681289, -0.48964247, -0.48762975, -0.48962881],\n",
       "        [-0.480736  , -0.4774801 , -0.47888385, -0.47894873, -0.47909465],\n",
       "        [-0.48793036, -0.48745781, -0.48806305, -0.48963099, -0.48889764]]),\n",
       " 2: array([[-0.51462348, -0.50884555, -0.51246217, -0.51022691, -0.51302403],\n",
       "        [-0.53005524, -0.53113195, -0.52453003, -0.53676926, -0.52839324],\n",
       "        [-0.52591936, -0.51035588, -0.50986539, -0.50856621, -0.50841111],\n",
       "        [-0.50752613, -0.49378346, -0.48939411, -0.49561905, -0.50103749],\n",
       "        [-0.52459675, -0.52231925, -0.52548452, -0.52526118, -0.52144515]])}"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lr_cv_L2.scores_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-0.232990935796\n",
      "-0.488200889929\n",
      "-0.515185876356\n"
     ]
    }
   ],
   "source": [
    "#打印每个类别的score\n",
    "for i in np.arange(0,3):\n",
    "    print(lr_cv_L2.scores_[i].mean().max())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZgAAAEKCAYAAAAvlUMdAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAIABJREFUeJzt3Xd8FXW6+PHPk0pJaGkEciBUMSL1\n0LGLqyhFhaCrq6x60V0Rd9Xd6xZ3verd4u7qz4IFy8re9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AAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x13955400>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "('C is:', array([ 100. ,    0.1,    1. ]))\n"
     ]
    }
   ],
   "source": [
    "# dict with classes as the keys, and the values as the grid of scores obtained during cross-validating each fold,\n",
    "# Each dict value has shape (n_folds, len(Cs))\n",
    "n_Cs = len(Cs)\n",
    "n_classes = 3\n",
    "scores =  np.zeros((n_classes,n_Cs))\n",
    "\n",
    "for j in range(n_classes):\n",
    "        scores[j][:] = np.mean(lr_cv_L2.scores_[j],axis = 0)\n",
    "    \n",
    "mse_mean = -np.mean(scores, axis = 0)\n",
    "pyplot.plot(np.log10(Cs), mse_mean.reshape(n_Cs,1)) \n",
    "#plt.plot(np.log10(reg.Cs)*np.ones(3), [0.28, 0.29, 0.30])\n",
    "pyplot.xlabel('log(C)')\n",
    "pyplot.ylabel('logloss')\n",
    "pyplot.show()\n",
    "\n",
    "print ('C is:',lr_cv_L2.C_)  #对多类分类问题，每个类别的分类器有一个C"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ -6.84643115e-02,   5.19500808e-02,  -1.48640152e-02,\n",
       "         -4.11360681e-02,  -4.10984930e-04,  -1.23424067e-03,\n",
       "         -7.25202478e-04,  -1.20414392e-01,  -1.65142307e-02,\n",
       "         -8.20485232e-04,  -2.21115187e-04,  -4.35612778e-03,\n",
       "          4.85680571e-02,  -1.04240788e-03,   7.02014220e-02,\n",
       "         -3.19324618e-02,   2.82799653e-03,   3.65872646e-02,\n",
       "         -6.91755908e-03,  -2.18116389e-01,  -2.06076388e-01,\n",
       "         -4.63862560e-03,  -4.68945589e-02,   2.48601407e-02,\n",
       "         -1.81894168e-03,   1.40207947e-03,  -2.12755316e-02,\n",
       "          8.74555761e-04,  -7.84620872e-03,  -4.86383397e-03,\n",
       "          2.22533476e-02,  -3.13056414e-03,  -6.24301972e-02,\n",
       "          1.01079415e-02,   4.08180828e-03,   1.64802419e-02,\n",
       "         -1.05609010e-02,  -2.28684742e-03,  -4.44418763e-03,\n",
       "         -1.06006073e-02,   3.38189302e-02,  -4.58889841e-03,\n",
       "         -1.11476349e-02,   1.01075507e-03,  -1.16977844e-02,\n",
       "          1.95530237e-03,  -3.21988884e-03,  -1.89936824e-02,\n",
       "          5.11419852e-03,  -8.12594500e-03,  -8.92952846e-03,\n",
       "          3.31901835e-03,  -5.85635902e-03,  -2.26642716e-03,\n",
       "          1.09156906e-01,  -1.93040915e-03,   5.90731212e-03,\n",
       "         -2.29043028e-02,   1.91475859e-02,  -2.60175547e-02,\n",
       "          2.88024179e-02,  -5.90313157e-03,  -1.35743511e-02,\n",
       "          2.50384214e-03,  -2.51319226e-03,  -5.04177789e-04,\n",
       "          2.10508185e-03,  -1.93672571e-03,   1.82454320e-02,\n",
       "          9.66407346e-04,  -4.95847613e-03,  -2.62222397e-02,\n",
       "          1.05124157e-02,  -2.83756617e-03,   1.24021017e-02,\n",
       "         -1.01014513e-02,  -3.56959837e-02,  -3.85533074e-03,\n",
       "         -3.71068468e-03,   5.66632195e-02,   1.18580726e-01,\n",
       "         -5.88013280e-02,   6.86676248e-02,   2.10508185e-03,\n",
       "         -2.42148085e-02,  -1.82329525e-02,  -7.67654478e-03,\n",
       "         -4.03956860e-03,   1.09814402e-01,  -2.12497719e-03,\n",
       "          8.51327645e-02,  -4.26398168e-03,  -2.61394658e-03,\n",
       "          4.14867396e-01,  -3.93833640e-02,   2.19633970e-02,\n",
       "         -4.77383663e-03,  -9.15630271e-03,   2.00382538e-01,\n",
       "          1.56874544e-02,  -6.79115937e-04,  -2.12497719e-03,\n",
       "         -4.28661569e-04,   7.59366879e-02,  -3.76837312e-02,\n",
       "          1.33511702e-02,  -1.01628659e-03,  -1.21199432e-02,\n",
       "          1.48507322e-03,  -8.20320823e-03,   8.10529051e-02,\n",
       "         -4.10581949e-03,  -2.12497719e-03,  -3.02955230e-02,\n",
       "         -1.09290976e-02,  -1.53862083e-02,   3.59717462e-03,\n",
       "         -3.45580073e-03,   3.26619490e-03,   4.36664963e-03,\n",
       "         -4.01413693e-03,  -4.11196214e-04,  -1.36926977e-02,\n",
       "         -1.15299666e-02,   5.08717728e-03,   1.58356453e-01,\n",
       "          1.35624719e-02,  -1.37895448e-02,  -4.70744291e-02,\n",
       "          6.63512257e-03,  -6.27903812e-03,  -1.90001766e-03,\n",
       "          8.07293627e-02,  -7.36333437e-03,  -9.61319118e-03,\n",
       "         -9.39572332e-02,  -6.73024411e-03,  -6.79542123e-03,\n",
       "         -9.77552871e-03,  -3.42370474e-03,  -1.39605481e-03,\n",
       "         -1.03204140e-03,   7.11772447e-03,   1.35624719e-02,\n",
       "          1.32356122e-03,   7.26757372e-03,  -1.19807455e-03,\n",
       "         -3.14071423e-03,   3.30508211e-02,  -1.13325491e-03,\n",
       "         -2.39326377e-03,  -1.65933904e-03,   1.27392634e-02,\n",
       "         -5.74876320e-04,  -1.05973089e-02,   2.22533476e-02,\n",
       "         -9.00444759e-03,  -6.30639048e-03,  -4.06502247e-03,\n",
       "         -1.28553210e-01,  -9.61642332e-02,  -1.32486868e-02,\n",
       "         -7.65325312e-03,   3.24545676e-03,  -2.67648149e-03,\n",
       "          3.42155688e-02,   7.57088285e-03,   1.70269692e-02,\n",
       "         -4.01315427e-03,  -2.12497719e-03,  -4.21214677e-02,\n",
       "         -6.55393229e-03,  -3.80431309e-03,   3.07547030e-02,\n",
       "          1.42409234e-02,   2.06652797e-02,  -2.90034133e-03,\n",
       "         -1.14058602e-02,  -4.21786271e-03,   1.78673104e-04,\n",
       "          2.07677427e-02,  -1.06817919e-01,  -4.26901675e-02,\n",
       "         -1.33503754e-03,  -4.43817550e-03,   6.01625111e-02,\n",
       "          3.68452753e-04,  -1.36926977e-02,  -1.03843053e-02,\n",
       "         -2.08677764e-03,   1.95451865e-02,   2.21580193e-02,\n",
       "          1.33320549e-03,  -3.18214577e-02,  -3.31061631e-03,\n",
       "          8.39266664e-03,  -1.36992581e-02,  -4.22104851e-02,\n",
       "         -1.37671670e-02,  -1.98214130e-03,  -2.05639413e-03,\n",
       "          2.07677427e-02,   3.13839768e-02,  -7.51193502e-03,\n",
       "         -2.31843748e-03,  -5.05664279e-03,  -7.61427724e-03,\n",
       "          4.46133057e-03,   6.77880385e-02,  -5.11417103e-03,\n",
       "         -1.16759935e-02,   0.00000000e+00,   3.40197846e-03,\n",
       "         -3.81614459e-04,  -7.25749709e-03,   1.41022245e-02,\n",
       "         -5.93089203e-03,  -1.32618232e-01,  -2.64073995e-02,\n",
       "          1.42109495e-02,  -2.92888650e-03,  -2.03779193e-03,\n",
       "         -1.19366336e-02,  -2.20644167e-03],\n",
       "       [ -5.07839634e-02,   8.01217393e-02,  -7.18258846e-03,\n",
       "         -3.54186236e-02,  -1.60873261e-04,  -6.75130633e-04,\n",
       "         -2.51531774e-04,  -1.30905703e-01,   2.93377760e-02,\n",
       "         -1.16981281e-03,   1.42607756e-03,  -1.28960788e-03,\n",
       "          4.59417423e-03,  -1.97949181e-03,   4.82700875e-02,\n",
       "          5.34240790e-02,   3.05659140e-02,   4.08665137e-02,\n",
       "         -1.26072094e-02,  -8.86487977e-02,  -4.06244925e-02,\n",
       "          4.30386280e-02,   1.28904668e-02,   1.16062969e-02,\n",
       "         -4.19365597e-03,   1.95253573e-03,   6.79602874e-03,\n",
       "         -2.11582451e-03,  -4.25483783e-03,  -3.70449524e-02,\n",
       "         -4.72587125e-03,   1.79168883e-03,  -1.77521472e-02,\n",
       "          1.03685430e-02,  -4.01236430e-03,   7.77680885e-04,\n",
       "         -1.05035353e-02,  -1.48516826e-03,   6.26651618e-03,\n",
       "          1.62413996e-02,   3.82402257e-02,  -2.21554876e-03,\n",
       "          7.38005826e-03,  -4.76478845e-03,   5.63197203e-03,\n",
       "         -3.12143588e-03,   3.30030248e-03,   3.71365733e-03,\n",
       "          6.59758256e-04,  -4.80615326e-03,   4.32632342e-03,\n",
       "          4.28007782e-04,  -6.65108384e-03,  -2.85597745e-03,\n",
       "          7.55144242e-02,  -5.26045992e-04,   1.43977914e-03,\n",
       "         -1.09727417e-02,   1.73433865e-02,   5.73433864e-03,\n",
       "         -8.45740869e-02,  -1.59973087e-03,   4.35124855e-03,\n",
       "         -4.83021776e-03,  -2.60443335e-03,  -4.63145379e-03,\n",
       "         -5.00857573e-03,   1.56052560e-03,   4.69659944e-03,\n",
       "         -8.16378616e-05,  -2.14959761e-03,   2.07308941e-02,\n",
       "         -4.20390971e-03,   2.53280530e-03,  -3.88407389e-02,\n",
       "          4.84005628e-03,  -3.75853641e-02,   1.27598525e-03,\n",
       "          4.95991334e-03,   3.16695968e-02,   1.73340269e-01,\n",
       "         -1.14357774e-02,  -1.92268465e-02,  -5.00857573e-03,\n",
       "         -8.48413115e-03,   2.82442677e-03,  -7.02983810e-03,\n",
       "         -2.13189521e-03,   3.11558601e-02,  -1.63485811e-03,\n",
       "         -2.27115549e-02,  -5.32930493e-03,  -9.40247271e-04,\n",
       "          2.88807690e-01,   3.11478497e-03,  -8.50234333e-02,\n",
       "         -2.90337012e-03,  -4.25546621e-03,   2.61381810e-01,\n",
       "          4.49872674e-04,   2.12553182e-03,  -1.63485811e-03,\n",
       "         -8.49453061e-04,   5.62720628e-02,  -3.36072155e-02,\n",
       "          3.00324782e-03,   3.92420908e-03,  -1.25595006e-02,\n",
       "         -2.95352218e-03,   2.49997908e-03,   1.59801709e-01,\n",
       "         -1.16925158e-03,  -1.63485811e-03,   4.43447740e-02,\n",
       "         -5.29847460e-03,   6.78691691e-03,   2.12769855e-03,\n",
       "         -1.14991393e-03,   9.81092412e-03,   1.90541608e-03,\n",
       "         -6.51714571e-03,   2.09602393e-03,   1.68095007e-02,\n",
       "         -3.61484359e-03,   3.12529563e-03,   1.18620692e-01,\n",
       "         -4.89046501e-03,   1.39092992e-02,  -1.79900352e-02,\n",
       "         -1.15226592e-03,  -2.56421532e-03,  -8.82792131e-04,\n",
       "          6.66664206e-02,   2.91203252e-04,  -1.20392491e-02,\n",
       "         -1.01369010e-01,   7.19976230e-03,   4.41654698e-03,\n",
       "          1.67226957e-03,   2.24303494e-03,   1.66422736e-03,\n",
       "         -1.08803632e-03,  -3.19229022e-04,  -4.89046501e-03,\n",
       "          1.45267388e-03,  -3.16474176e-02,   3.97370115e-03,\n",
       "          1.02961107e-03,   5.84962185e-02,  -3.70929013e-03,\n",
       "         -3.34134688e-03,   2.23199885e-02,  -2.09819376e-03,\n",
       "         -4.55028715e-04,  -9.08032789e-03,  -4.72587125e-03,\n",
       "         -8.76750357e-03,  -3.15672112e-02,   1.57873113e-04,\n",
       "         -4.24103670e-02,  -1.15895607e-01,   5.14638618e-02,\n",
       "         -1.06348119e-02,  -2.30881665e-03,   1.16273635e-03,\n",
       "          4.26574857e-02,   2.95262529e-02,  -3.73850820e-03,\n",
       "         -6.66191739e-03,  -1.63485811e-03,  -3.44764365e-02,\n",
       "         -6.75251618e-03,   2.99040864e-03,  -7.55493068e-03,\n",
       "          5.23146343e-04,  -2.14043481e-03,  -1.38050696e-03,\n",
       "          2.40265733e-03,   4.89626283e-03,   1.99258617e-03,\n",
       "          4.47620244e-03,  -1.11152435e-01,   1.54026553e-02,\n",
       "         -7.42023966e-04,  -4.55430439e-04,   7.68147254e-02,\n",
       "         -9.61697345e-04,   1.68095007e-02,   3.74579691e-03,\n",
       "          4.42851311e-05,   6.51557396e-03,   6.12707032e-03,\n",
       "         -2.35982902e-03,   7.86798557e-03,   1.96197086e-03,\n",
       "         -3.72288349e-03,   1.11755177e-02,  -2.36705337e-02,\n",
       "          6.47157953e-03,  -2.59608316e-02,  -2.65656765e-03,\n",
       "          4.47620244e-03,  -7.96716913e-03,  -4.91035702e-04,\n",
       "          7.04986113e-04,   8.79674234e-04,   8.17712448e-03,\n",
       "         -4.26674046e-04,   6.67570621e-02,   4.80491067e-03,\n",
       "          4.62608771e-04,   0.00000000e+00,  -4.80469588e-03,\n",
       "          1.95280742e-03,  -4.08467428e-03,   6.09714842e-03,\n",
       "          1.87107829e-03,  -4.22524939e-02,  -1.05735708e-02,\n",
       "         -2.28325675e-03,  -3.42662413e-02,  -2.32126102e-03,\n",
       "          7.68817338e-03,   2.94946282e-03],\n",
       "       [  2.46962593e-01,  -8.03071466e-02,   6.32048410e-02,\n",
       "          8.20765886e-02,  -8.10717467e-05,   1.79387971e-03,\n",
       "          5.67578059e-04,   3.27269740e-01,   1.66655447e-01,\n",
       "          7.11547796e-04,  -4.04104714e-03,   1.93471668e-03,\n",
       "         -3.47756881e-02,   2.14253914e-03,  -6.86571233e-02,\n",
       "         -4.92497103e-02,  -5.84158793e-02,  -1.72559548e-01,\n",
       "          5.50073081e-02,   2.45889832e-01,   1.32730896e-01,\n",
       "         -5.48800715e-02,   4.59250372e-02,  -3.46267873e-02,\n",
       "          1.33149610e-02,  -8.83915290e-03,  -7.03777779e-04,\n",
       "          2.63915234e-03,   1.83444590e-02,   7.06370237e-02,\n",
       "         -1.54820540e-02,  -9.08948167e-04,   2.61363862e-02,\n",
       "         -3.38878801e-02,  -1.94840544e-03,  -2.30453180e-02,\n",
       "          4.86330660e-02,   5.52295078e-03,  -1.15367097e-02,\n",
       "         -3.34303136e-02,  -6.02145119e-02,   8.92130343e-03,\n",
       "         -8.65412177e-03,   1.29763276e-02,  -3.72441947e-03,\n",
       "          6.43958885e-03,  -6.09565024e-03,   6.58943704e-03,\n",
       "         -9.08289093e-03,   2.20902575e-02,  -5.84850871e-03,\n",
       "         -5.82458563e-03,   2.38197014e-02,   1.07155078e-02,\n",
       "         -1.34291419e-01,   2.08951586e-03,  -1.15378262e-02,\n",
       "          1.02423827e-02,  -7.55561214e-02,   4.24137357e-03,\n",
       "          7.72274880e-02,   1.34032177e-02,  -1.42427632e-03,\n",
       "          1.03194073e-02,   6.34653607e-03,   8.86362227e-03,\n",
       "          1.04588639e-02,  -2.52921774e-03,  -3.09205740e-02,\n",
       "         -3.32093180e-03,   1.03770892e-02,  -1.30138418e-02,\n",
       "         -8.02589700e-03,  -3.93997960e-03,   6.43016555e-02,\n",
       "         -5.37797667e-03,   6.13943410e-02,   5.93883513e-04,\n",
       "         -1.01385794e-02,  -6.66615755e-02,  -1.74418647e-01,\n",
       "          5.36530637e-02,  -1.16619889e-02,   1.04588639e-02,\n",
       "          5.22350837e-02,   1.36485682e-02,   1.96618296e-02,\n",
       "          1.13871372e-02,  -1.25491325e-01,   5.18744676e-03,\n",
       "         -7.77866083e-02,   1.80577053e-02,   6.70153188e-03,\n",
       "         -6.57642235e-01,   4.09458974e-02,   7.88981387e-02,\n",
       "          1.38560089e-02,   2.71232025e-02,  -3.82736999e-01,\n",
       "         -1.66769866e-02,  -4.13298954e-03,   5.18744676e-03,\n",
       "          2.86166194e-03,  -2.50478013e-01,   8.19800913e-02,\n",
       "          1.36946425e-02,  -9.46841224e-03,   4.53488670e-02,\n",
       "          8.37374428e-03,  -2.93323305e-03,  -5.44680716e-03,\n",
       "          6.54022433e-03,   5.18744676e-03,  -1.07372249e-01,\n",
       "          2.87461370e-02,  -7.09920588e-03,  -1.17518564e-02,\n",
       "          6.67207886e-03,  -3.62855139e-02,  -1.04434670e-02,\n",
       "          2.05235269e-02,  -5.62238882e-03,  -3.68801155e-02,\n",
       "          8.87668370e-03,  -1.73214863e-02,  -1.65593110e-01,\n",
       "          9.87384231e-03,  -2.30172610e-02,   9.02140174e-02,\n",
       "         -7.17862852e-03,   1.31948146e-02,   3.20699312e-03,\n",
       "         -2.18264827e-01,   6.74276575e-03,   3.47687204e-02,\n",
       "          3.47633155e-01,  -1.72399348e-02,  -4.08807710e-03,\n",
       "          6.69006470e-03,  -1.21503098e-04,  -3.80487413e-03,\n",
       "          4.13848972e-03,  -5.10722778e-03,   9.87384231e-03,\n",
       "         -5.43527962e-03,   4.84881517e-02,  -1.14133414e-02,\n",
       "         -2.54773532e-03,  -2.46538300e-02,   9.99948711e-03,\n",
       "          1.19179509e-02,  -5.77411353e-02,   3.55901849e-02,\n",
       "          3.24326070e-03,   3.49776049e-02,  -1.54820540e-02,\n",
       "          3.14386362e-02,   4.84185554e-02,   2.37957023e-03,\n",
       "          1.33003676e-01,   3.65648039e-01,  -1.15198650e-01,\n",
       "          1.63731838e-02,   1.68212794e-03,   1.08508150e-03,\n",
       "         -1.43457065e-01,  -8.55770460e-02,  -1.14782263e-02,\n",
       "          1.75696571e-02,   5.18744676e-03,   6.01885054e-02,\n",
       "          2.46653909e-02,  -5.63069703e-03,   2.18457796e-02,\n",
       "         -1.85966673e-02,  -2.16244576e-02,   6.34012300e-03,\n",
       "          4.17699878e-03,  -8.05302815e-03,  -8.95643111e-03,\n",
       "         -4.07652150e-02,   3.89984465e-01,  -2.22036942e-03,\n",
       "          3.87284306e-03,   6.18381430e-03,  -1.06905428e-01,\n",
       "         -6.63764884e-04,  -3.68801155e-02,  -2.15615832e-03,\n",
       "          4.02792213e-03,  -3.40720957e-02,  -3.66684081e-02,\n",
       "          4.40568708e-03,   6.89474705e-03,  -1.87946771e-03,\n",
       "         -1.17450512e-03,  -1.85028424e-02,   1.03955351e-01,\n",
       "         -6.54206336e-03,   4.52449070e-02,   1.03143060e-02,\n",
       "         -4.07652150e-02,   3.98374945e-02,   3.69164975e-03,\n",
       "          7.11506243e-04,  -1.23120615e-03,  -1.61451962e-02,\n",
       "         -4.15667351e-03,  -7.54041661e-02,  -7.44437967e-03,\n",
       "          9.67236396e-03,   0.00000000e+00,   8.62720060e-03,\n",
       "         -5.23779947e-03,   2.37248748e-02,  -2.88213918e-02,\n",
       "         -6.60913729e-04,   1.35383246e-01,   6.23388765e-02,\n",
       "         -1.12265968e-02,   6.52287018e-02,   4.98820691e-03,\n",
       "         -9.65178044e-03,  -6.31025579e-03]])"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lr_cv_L2.coef_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.14"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
